<?php
	session_start();
	require_once("../db_connect.php");
	require_once("filter.php");

	//メインカテゴリ一覧表示
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet"  href="../../css/admin.css" type="text/css" />
<head>
<title>管理者画面</title>
</head>
       <body>
		<div id="topmain" >
			<div id="topwaku">カテゴリ管理</div>
				<div id="enpty"></div>
					<div id="topimage"><a href="manager_create.php" >管理者登録</a></div>
					<div id="topimage"><a href="ManagerLogout.php" >ログアウト</a></div>
		</div>
		<div id="leftmain">
			<div id="leftmainwaku">
				<div id="koumoku"><a href="../../manager_index.php" >・管理トップページ</a></div>
				<div id="koumoku"><a href="manage_main_category_insert.php" >・新規<br/>　　カテゴリ登録</a></div>
			</div>
		</div>
		<div id="centerup">
		<div id="centerwaku">
			<div id="centertitle">
				<div id="centerchara">メインカテゴリ一覧</div>
			</div>
			</div>
			<div id="centerinsert">
			<div id="centerinsert2">
<table border="1" >
<tr>
<th>メインカテゴリID</th>
<th>メインカテゴリ名</th>
<th>詳細</th>
<th>編集</th>
<th>削除</th>
</tr>
<?php

$sth = "SELECT main_category_id,main_category_name
		FROM category";

$res =& $db->query($sth);
	if (PEAR::isError($res)) {			//SQLの実行に失敗すればここでエラー文を出力
		die($res->getMessage());
	}
	while ($row =& $res->fetchRow(DB_FETCHMODE_ASSOC)) {
		echo "<tr>";
		echo "<th>".$row['main_category_id']."</th>";
		echo "<th>".$row['main_category_name']."</th>";
		echo "<th><a href='manage_main_category_detail.php?main_category_detail_id=".$row['main_category_id']."' >詳細</a></th>";
		echo "<th><a href='manage_main_category_update.php?main_category_update_id=".$row['main_category_id']."' >編集</a></th>";
		echo "<th><a href='ManageMainCategoryDelete.php?main_category_delete_id=".$row['main_category_id']."' >削除</a></th>";
		echo "</tr>";
	}
?>
</table>
</div>
			</div>
		</div>
</body>
</html>